// import { Suspense, lazy, ReactNode } from "react";
import Layout from "~/layouts/MainLayout";

import type { RouteConfig } from "./types";
import { lazy } from "react";

import NotFound from "~/pages/p404"
import LoginPage from "~/pages/auth/Login"
const HomePage =lazy(() => import("~/pages/index"))

// const Layout = lazy(() => import("../components/Layout"));

/*
const LayoutComponent = ({ children }: any) => {
  return (
    <Suspense fallback={""}>
      <Layout />
    </Suspense>
  );
};
*/



export const routers:RouteConfig[] = [
  { path: "/login", element: <LoginPage />, auth: false },
  {
    path: "/",
    element: <Layout />,
    auth: true,
    children: [
      { path: "/", element: <HomePage />, auth: true },
    ],
  },
  { path: "*", element: <NotFound />, auth: false }
];

export default routers